﻿/*
 * Last review by   : Yaser
 * Last review date : JUL-27-09
 */
using System;
using System.Collections.Generic;

namespace ERP.Business.DataTypes.Employee.Salary
{
    /// <summary>
    /// Salary Information
    /// </summary>
    [System.Runtime.Serialization.DataContract]
    [Serializable]
    [System.Runtime.Serialization.KnownType(typeof(SalaryInformation))]
    public class SalaryInformation : BaseTypes.BaseType
    {
        #region Properties

        /// <summary>
        /// Gets or sets the start date.
        /// </summary>
        /// <value>The start date.</value>
        [System.Runtime.Serialization.DataMember]
        public DateTime StartDate
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the end date.
        /// </summary>
        /// <value>The end date.</value>
        [System.Runtime.Serialization.DataMember]
        public DateTime EndDate
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the basic salary.
        /// </summary>
        /// <value>The basic salary.</value>
        [System.Runtime.Serialization.DataMember]
        public float BasicSalary
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the type of the payment.
        /// </summary>
        /// <value>The type of the payment.</value>
        [System.Runtime.Serialization.DataMember]
        public PaymenType PaymentType
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the bank info.
        /// </summary>
        /// <value>The bank info.</value>
        [System.Runtime.Serialization.DataMember]
        public BankInformation BankInfo
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the penalties.
        /// </summary>
        /// <value>The penalties.</value>
        [System.Runtime.Serialization.DataMember]
        public List<Penalty> Penalties
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the deductions.
        /// </summary>
        /// <value>The deductions.</value>
        [System.Runtime.Serialization.DataMember]
        public List<DeductionEntry> Deductions
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the loans.
        /// </summary>
        /// <value>The loans.</value>
        [System.Runtime.Serialization.DataMember]
        public List<Loan> Loans
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the work permits.
        /// </summary>
        /// <value>The work permits.</value>
        [System.Runtime.Serialization.DataMember]
        public List<WorkPermit> WorkPermits
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the transportations.
        /// </summary>
        /// <value>The transportations.</value>
        [System.Runtime.Serialization.DataMember]
        public List<Transportation> Transportations
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the raises.
        /// </summary>
        /// <value>The raises.</value>
        [System.Runtime.Serialization.DataMember]
        public List<Raise> Raises
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the bounuses.
        /// </summary>
        /// <value>The bounuses.</value>
        [System.Runtime.Serialization.DataMember]
        public List<Bonus> Bounuses
        {
            get;
            set;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public override object Clone()
        {
            SalaryInformation si = new SalaryInformation();
            si.BankInfo = (BankInformation)BankInfo.Clone();
            si.BasicSalary = BasicSalary;
            si.Bounuses = Bounuses;
            si.Deductions = Deductions;
            si.ID = ID;
            si.Loans = Loans;
            si.PaymentType = this.PaymentType;
            si.Penalties = Penalties;
            si.Raises = Raises;
            si.Transportations = Transportations;
            si.WorkPermits = WorkPermits;
            return si;
        }

        #endregion
    }
}
